<?php require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('info'); ?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>修改单页信息</title>
<link href="templates/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="templates/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/jquery.nicescroll.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/laymain.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/common.js"></script>
<script type="text/javascript" src="templates/js/getuploadify.js"></script>
<script type="text/javascript" src="templates/js/getinfosrc.js"></script>
<script type="text/javascript" src="plugin/colorpicker/colorpicker.js"></script>
<script type="text/javascript" src="plugin/calendar/calendar.js"></script>
<script type="text/javascript" src="../plugin/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="../plugin/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
   $(function () {
        //初始化表单验证
        $("#form").initValidform();
    });
	
function GetDone(data, textStatus, xmlHttp)
{
	if(data != '')
	{
		var str = data;
		var arr = new Array();
		arr = str.split('[-||-]');
		$("#content").val(arr[0]);
		$("#picurl").val(arr[1]);
		$("#posttime").val(arr[2]);

		//设置编辑器内容
		editor.html(arr[0]);
	}
	$("#loading2").attr("class","undis");
}
</script>
</head>

<body class="mainbody">
<?php
$row = $dosql->GetOne("SELECT * FROM `#@__info` WHERE `classid`=$id AND `mainid`=-1");

$content  = isset($row['content'])  ? $row['content']  : '';
$picurl   = isset($row['picurl'])   ? $row['picurl']   : '';
$posttime = isset($row['posttime']) ? GetDateTime($row['posttime']) : GetDateTime(time());
?>
<form name="form" id="form" method="post" action="info_save.php">
<!--导航栏-->
<div class="location">
  <a href="javascript:history.back(-1);" class="back"><i></i><span>返回列表页</span></a>
  <a href="home.php" class="home"><i></i><span>首页</span></a>
  <i class="arrow"></i>
  <a href="javascript:history.back(-1);"><span>内容管理</span></a>
  <i class="arrow"></i>
  <span>修改单页信息</span>
  <a href="javascript:location.reload();" class="reload">刷新</a> 
</div>
<div class="line10"></div>
<!--/导航栏-->

<!--内容-->
<div id="floatHead" class="content-tab-wrap">
  <div class="content-tab">
    <div class="content-tab-ul-wrap">
      <ul>
        <li><a class="selected" href="javascript:;">修改<?php
				$r = $dosql->GetOne("SELECT `classname` FROM `#@__infoclass` WHERE `id`=$id");
				if(isset($r['classname']))
					echo $r['classname'];
				?></a></li>
      </ul>
    </div>
  </div>
</div>

<div class="tab-content">
 <dl>
 <dt>栏目名称</dt>
 <dd><strong>
				<?php
				
					echo $r['classname'];
				?>
				</strong></dd>
 </dl>
		<div id="df">
			<?php echo GetDiyField('0',$id,$row);?>
		</div>
<dl>
    <dt>内容描述</dt>
    <dd>
     <textarea name="content" id="content" ><?php echo $content; ?></textarea>
				<script type="text/javascript">
			 var ue = new UE.ui.Editor({initialFrameWidth:667,
						initialFrameHeight:280,
						wordCount:false});
				 ue.render('content');
			</script>
    </dd>
  </dl>
	<dl>
    <dt>封面图片</dt>
    <dd>
     <input name="picurl" type="text" id="picurl" class="input normal" value="<?php echo $picurl; ?>" /> <div class="upload-box upload-img">
	<div class="webuploader-pick"  onmousemove="this.className='webuploader-pick webuploader-pick-hover'" onmouseout="this.className='webuploader-pick'" onclick="GetUploadify('uploadify','缩略图上传','image','image',1,<?php echo $cfg_max_file_size; ?>,'picurl')">浏览...</div> 
	</div>
    </dd>
  </dl>	
   <dl>
    <dt>发布时间</dt>
    <dd>
      <input name="posttime" type="text" value="<?php echo $posttime; ?>" id="posttime" class="input rule-date-input"  datatype="/^\s*$|^\d{4}\-\d{1,2}\-\d{1,2}\s{1}(\d{1,2}:){2}\d{1,2}$/" errormsg="请选择正确的日期" sucmsg=" " />
      <span class="Validform_checktip">不选择默认当前发布时间</span>
	  <script type="text/javascript">
				date = new Date();
				Calendar.setup({
					inputField     :    "posttime",
					ifFormat       :    "%Y-%m-%d %H:%M:%S",
					showsTime      :    true,
					position       :    [180, 450],
					timeFormat     :    "24"
				});
		</script>
    </dd>
  </dl>
</div>
<!--/内容-->

<!--工具栏-->
<div class="page-footer">
  <div class="btn-wrap">
  <input type="submit" name="btnSubmit" value="提交保存" id="btnSubmit" class="btn" />
    <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript:history.back(-1);" />
	<input type="hidden" name="action" id="action" value="update" />
		<input type="hidden" name="action" id="action" value="update" />
		<input type="hidden" name="classid" id="classid" value="<?php echo $id; ?>" />
		<input type="hidden" name="classname" id="classname" value="<?php 	echo $r['classname']; ?>" />
  </div>
</div>
<!--/工具栏-->

</form>
</body>
</html>